//
//  API.h
//  iWeddingDirectory
//
//  Created by Tung Ngo on 5/19/12.
//  Copyright (c) 2012 Home. All rights reserved.
//

#import <Foundation/Foundation.h>

#define kCategoriesReceivedNotification @"kCategoriesReceivedNotification"
#define kSubCategoriesReceivedNotification @"kSubCategoriesReceivedNotification"
#define kPostsReceivedNotification      @"kPostsReceivedNotification"
#define kPostReceivedNotification       @"kPostReceivedNotification"
#define kResultReceivedNotification     @"kResultReceivedNotification"
#define kLoginNotification              @"kLoginNotification"
#define kRegisterNotification           @"kRegisterNotification"
#define kForgotPasswordNotification     @"kForgotPasswordNotification"
#define kContactUsNotification          @"kContactUsNotification"
#define kSendInquiryNotification        @"kSendInquiryNotification"
#define kMyDetailNotification           @"kMyDetailNotification"
#define kInboxNotification              @"kInboxNotification"


typedef enum {
    API_GET_CATEGORIES,
    API_GET_SUB_CATEGORIES,
    API_GET_POSTS,
    API_GET_POST,
    API_SEARCH,
    API_LOGIN,
    API_REGISTER,
    API_FORGOT_PASSWORD,
    API_CONTACT_US,
    API_SEND_INQUIRY,
    API_GET_MYDETAIL,
    API_GET_INBOX
} APIMethod;

@interface API : NSObject <NSURLConnectionDelegate, NSURLConnectionDataDelegate>

@property (nonatomic, assign) APIMethod method;
@property (nonatomic, retain) NSMutableData *receivedData;

+ (API *)sharedInstance;
- (void)getCategories;
- (void)getSubCategories;
- (void)getPostsInCategoryWithId:(int)categoryId;
- (void)getPostWithId:(int)postId;
- (void)searchForText:(NSString *)searchText;
- (void)loginWithUsername:(NSString *)username andPassword:(NSString *)password;
- (void)registerWithUsername:(NSString *)username email:(NSString *)email password:(NSString *)password website:(NSString *)website message:(NSString *)message mobile:(NSString *)mobile;
- (void)forgotPasswordWithEmail:(NSString *)email;
- (void)contactUsWithName:(NSString *)name message:(NSString *)message email:(NSString *)email;
- (void)sendInquiry:(NSString *)ids email:(NSString *)email name:(NSString *)name subject:(NSString *)subject message:(NSString *)message;
- (void)getUserDetail:(NSString *)userCookie;
- (void)getUserInbox:(NSString *)userCookie;

@end
